# 2024/1/10 18:43 HFL
import re
from random import randint, choices


def randomPhone():
    num = choices(['136', '125', '182', '134', '175'])
    num1 = str(randint(10000000,99999999))
    return num[0]+num1

def code ():
    num = choices(['A', 'B', 'C', 'D'])
    num2 = choices(['a', 'c', 'c', 'd'])
    num3 = str(randint(10,99))
    return num[0]+num2[0]+num3
"""
编写一个函数,提取指定字符串中所有的数字,然后拼接在一起产生一个新的字符串
例如: 传入'12a&bc12d-+'   -->  '1212'
"""
def coc(num):
    # 使用re函数.findall 方法进行查找所有的数据进行筛选数字
    result = re.findall(r'\d+', num)
    # 进行拼接
    result = ''.join(result)
    return result

def do(num):
    result=''

    for i in num:
        if i.isdigit():
            result += i

    return result

if __name__ == '__main__':
    print(randomPhone())
    print(code())
    num = ('sldfggksdf'
           '65s65f46sdfsd5f46sdf')
    print(do(num))

